<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>

<html lang="en">
<head>
		<%@ include file="/common/common-css.v2.jsp" %>
		<style>
		#jquery-table td{cursor:pointer !important}
		.load_bg{background:#000;opacity:0.1;left:0px;top:0px;position:fixed;height:100%;width:100%;overflow:hidden;z-index:10000;}
		.load_img{left:50%;top:180px;position:fixed;height:50px;overflow:hidden;z-index:20000;}
		</style>
</head>
<body class="no-skin">
<img src="http://img.xmiles.cn/commentloading.gif" class="load_img" style="display:none"/>
<div class="page-content">
<!-- 	<form id="queryForm" autocomplete="off"> -->
	<div class="page-content-area">
		<div class="row">
		<div class="col-md-12">
			<div class="widget-header widget-header-blue widget-header-flat">
						<h4 class="widget-title">话费充值</h4>

						<div class="widget-toolbar">
							<a href="#" data-action="collapse">
								<i class="ace-icon fa fa-chevron-up"></i>
							</a>
						</div>
			</div>
			<div class=" widget-body">
				<div class="widget-main clearfix" >
					<div class="form-group col-xs-12 col-sm-4 col-md-3 col-lg-3">									
							<label class="col-sm-6 control-label"  style="text-align:right" >手机号码:</label> 
							<div class="col-sm-6">
								<input type="text" class="input-sm form-control" style="padding-left:0px" name="number" id="number" > 
							</div>
					</div>
					
					<div class="form-group col-xs-12 col-sm-4 col-md-3 col-lg-3">									
							<label class="col-sm-6 control-label"  style="text-align:right" >金额:</label> 
							<div class="col-sm-6">
								<input type="text" class="input-sm form-control" style="padding-left:0px" name="amount" id="amount">
							</div>
					</div>
					
					<div class="form-group col-xs-12 col-sm-4 col-md-3 col-lg-3">									
							<label class="col-sm-6 control-label"  style="text-align:right" >活动分类（备注）:</label> 
							<div class="col-sm-6">
								<input type="text" class="input-sm form-control" style="padding-left:0px" name="memo" id="memo">
							</div>
					</div>
										
				</div><!-- /.widget-main -->
			</div><!-- /.widget-body -->
		</div>
		<div class="col-md-12">
			<div class="clearfix form-actions" >
			<button class="btn  btn-success no-border" name="btn-save"
				id="btn-submit">
				<i class="ace-icon fa fa-floppy-o bigger-160"></i> 确认充值
			</button>
			</div>
		</div>
<!-- 	</form> -->
	</div>
	</div>
</div>
	<%@ include file="/common/common-js.jsp"%>
	<script>
		jQuery(function() {
			//【提交】按钮Click事件
			
			$("#btn-submit").bind("click", function() {
	   			
	   			$("#btn-submit").attr("disabled","disabled");
				var number = $("#number").val();
	   			var amount = $("#amount").val();
	   			var memo = $("#memo").val();
	   			var result = window.confirm("确定对手机号码:" + number +  "充值：" + amount + "元?");
	   			if(result){
					$.ajax({
						"dataType": 'json',
						"url": ctx+"/phonefee/recharge.action?number=" + number + "&amount=" + amount + "&memo=" + memo,//数据源URL,
						success : function(resp){
							$(".load_bg").attr("style","display:none");
							$(".load_img").attr("style","display:none");
							if(resp.status == 1){
								alert('充值成功：' + resp.message);
							}else{
								alert('充值失败：' + resp.message);
							}
							$("#btn-submit").removeAttr("disabled");
						},		
						error : function(XMLHttpRequest, textStatus, errorThrown) {
							$(".load_bg").attr("style","display:none");
							$(".load_img").attr("style","display:none");
							alert('请求服务器错误,请刷新重试！！');//错误提示，包括服务器重启导致的session失效
							$("#btn-submit").removeAttr("disabled");
						},				
					});
				}
			});

		});
	</script>
</body>
</html>